<template>
	<view class="contents" :style="'height:'+screenHeight+'px;'">

		<view class="none" v-if="show">
			<view class="coent">
				<u-empty text="暂无报告" mode="list" icon-size="200"></u-empty>
			</view>
		</view>
		<view class="conentaa" v-else>
			<view class="mzlist" v-for="(item,index) in datalist" :key="index" @click="detil(item.tjid)">
				<view class="mzhz">
					<view class="mztite">
						[&nbsp;{{item.tcname}}&nbsp;]
					</view>
					<view class="mznr">
						<view class="mztiao">
							<view class="mzaone">
								姓名:
							</view>
							<view class="mzbtwo">
								胡越南
							</view>
						</view>
						<view class="mztiao">
							<view class="mzaone">
								结果与建议:
							</view>
							<view class="mzbtwo">
							{{item.jg}}
							</view>
						</view>
						<view class="mztiao">
							<view class="mzaone">
								更新时间:
							</view>
							<view class="mzbtwo">
								{{item.djdate}}
							</view>
						</view>
					</view>
					<view class="an" style="">
						<view class="">
							
						</view>
						<view class="">
							<u-button type="primary" size="mini" :plain="true">查看报告</u-button>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				jianyival: '',
				screenHeight: getApp().globalData.screenHeight - 44,
				datalist: [{
						tjid: "16",
						tcname: "基础体检套餐",
						djdate: "2024-10-21",
						zs: "◎一般检查：\r\n身高：180 cm\r体重：80 Kg\r体质指数(BMI)：24.69 \r\r\n",
						jg: "◎肥胖：\r肥胖是高血压、冠心病的危险因素，也是糖尿病、高脂血症和高血液粘稠度的病因，请用低脂低热高纤维素膳食，坚持有氧运动，控制体重。\r\r"
					},
					{
						tjid: "17",
						tcname: "经济体检套餐",
						djdate: "2024-10-21",
						zs: "◎一般检查：\r\n身高：190 cm\r体重：92 Kg\r体质指数(BMI)：25.48 \r\r\n",
						jg: "◎嗜酒：\r适量饮酒\r\r"
					}
				],
			}
		},
		onLoad() {
			// this.list()
		},
		methods: {
			detil(e) {

				uni.navigateTo({
					url: `/pages/zhuyaun/tijian/tijiandetil?tjid=${e}`
				})
			},
			list() {
				uni.showLoading({
					title: '请稍后',
					mask: true
				});
				this.$request("tj", "tjlist").then(res => {
					console.log("体检报告", res)
					if (res.code == 1) {
						this.datalist = res.data.resultdata
						this.show = false
						uni.hideLoading();
					} else {
						this.show = true
						uni.hideLoading();
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				}).catch(err => {
					this.show = true
					uni.hideLoading();
					console.log("err", err)
					uni.showToast({
						title: err,
						icon: 'none',
						duration: 1000
					});
				});
			}
		}
	}
</script>

<style>
	@import './tijian.css';
</style>